<template>
  <div class="title">
    <div class="title__left">
      <span class="circle"></span>
      <span class="label">{{ props.title }}</span>
    </div>
    <div class="title__right" v-if="showCloseIcon">
      <el-icon color="#86909C" size="20" @click="closeDialog"><Close /></el-icon>
    </div>
  </div>
</template>
<script setup>
const props = defineProps({
  title: {
    type: String,
    default: ""
  },
  showCloseIcon: {
    type: Boolean,
    default: false
  }
});

const emit = defineEmits(["handleCloseDialog"]);

const closeDialog = () => {
  emit("handleCloseDialog");
};
</script>
<style scoped lang="scss">
.title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.title__left {
  display: flex;
  align-items: center;
  .circle {
    width: 6px;
    height: 6px;
    margin-right: 9px;
    border-radius: 50%;
    background-color: #409eff;
  }
  .label {
    font-size: 18px;
    color: #131414;
    line-height: 24px;
  }
}
.title__right {
  cursor: pointer;
}
</style>
